package design.patterns.pc;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test {

    public static void main(String[] args){
        BlockingQueue blockingQueue = new ArrayBlockingQueue(10);
        Producer p1 = new Producer(blockingQueue);
        Producer p2 = new Producer(blockingQueue);
        Consumer c1 = new Consumer(blockingQueue);
        Consumer c2 = new Consumer(blockingQueue);
        Consumer c3 = new Consumer(blockingQueue);
        ExecutorService sc= Executors.newCachedThreadPool();
        sc.execute(p1);sc.execute(p2);
        sc.execute(c1);sc.execute(c2);sc.execute(c3);


    }
}
